<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标悬停</title>
    <style>
        .mhover{
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #434750;
        }
        .mhover ul{
            position: relative;
            transform: skewY(-15deg);
            transition: .5s;
        }
        .mhover ul li{
            position: relative;
            list-style: none;
            width: 200px;
            background: #3e3f46;
            padding: 15px;
            transition: .5s;
            z-index: var(--i);
        }
        .mhover ul li:hover{
            background: #33a3ee;
            transform: translateX(-50px);
        }
        .mhover ul li::before{
            content: " ";
            position: absolute;
            width: 40px;
            height: 100%;
            top: 0;
            left: -40px;
            background: #2e3133;
            transform-origin: right;
            transform: skewY(45deg);
            transition: .5s;
        }
        .mhover ul li:hover::before{
            background: #1f5378;
        }
        .mhover ul li::after{
            content: "";
            position: absolute;
            top: -40px;
            left: 0;
            width: 100%;
            height: 40px;
            transform-origin: bottom;
            transform: skewX(45deg);
            background: #35383e;
            transition: .5s;
        }
        .mhover ul li:hover::after{
            background: #2982b9;
        }
        .mhover ul li a{
            text-decoration: none;
            color: #999;
            display: block;
            text-transform: uppercase  ;
            letter-spacing: 0.05em;
            transition: .5s;
        }
        .mhover ul li:hover a{
            color: #fff;
        }
    </style>
</head>
<body>
    <div class="mhover">
        <ul>
            <li style="--i:6"><a href="#">Home</a></li>
            <li style="--i:5"><a href="#">About</a></li>
            <li style="--i:4"><a href="#">Services</a></li>
            <li style="--i:3"><a href="#">Portfolio</a></li>
            <li style="--i:2"><a href="#">Our Team</a></li>
            <li style="--i:1"><a href="#">Contact</a></li>
        </ul>
    </div>
</body>
</html>